<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/menu::head"></head>
<body>
<span th:replace="common/menu::menu"></span>

<div th:unless="${#lists.isEmpty(starList)}">
    <table>
        <thead>
        <tr>
            <th>id</th>
            <th>g</th>
            <th>sys</th>
            <th>p</th>
            <th>lately</th>
            <th>ack</th>
            <th>rank</th>
            <th>build</th>
            <th>resource</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="star : ${starList}">
            <td th:text="${star.id}"></td>
            <td th:text="${star.galaxy}"></td>
            <td th:text="${star.system}"></td>
            <td th:text="${star.slot}"></td>
            <td th:text="${star.lately}"></td>
            <td th:text="${star.attack}=='0'?'':(${star.attack}=='1'?'X':'O')" bgcolor="#FFFFE0" align="center"></td>
            <td th:text="${star.rank}"></td>
            <td th:text="${star.build}"></td>
            <td th:text="${star.resource}"></td>
        </tr>
        </tbody>
    </table>
</div>

<div>
    <form action="#" th:action="@{/star/add}" method="post">
        <table>
            <thead>
            <tr>
                <th width="10px">glx</th>
                <th width="20px">sys</th>
                <th width="10px">slot</th>
                <th width="20px">lately</th>
                <th width="5px">ack</th>
                <th width="20px">rank</th>
                <th width="10px">build</th>
                <th width="30px">resource</th>
                <th width="20px">opera</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td><input type="text" id="galaxy" name="galaxy" maxlength="1" size="1"/></td>
                <td><input type="text" id="system" name="system" maxlength="3" size="2"/></td>
                <td><input type="text" id="slot" name="slot" maxlength="2" size="1"/></td>
                <td><input type="text" id="lately" name="lately" maxlength="8" size="4"/></td>
                <td>
                    <select id="attack" name="attack">
                        <option value="0">未试</option>
                        <option value="1">成功</option>
                        <option value="2">失败</option>
                    </select>
                </td>
                <td><input type="text" id="rank" name="rank" maxlength="4" size="3"/></td>
                <td><input type="text" id="build" name="build" maxlength="4" size="3"/></td>
                <td><input type="text" id="resource" name="resource" maxlength="4" size="3"/></td>
                <td><input type="submit" value="提交"></td>
            </tr>
            </tbody>
        </table>
    </form>
</div>

<div>
    <form action="#" th:action="@{/star/del}" method="post" target="delIframe">
        <table>
            <thead>
            <tr>
                <th width="20px">id</th>
                <th width="20px">opera</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td><input type="text" id="id" name="id" size="3"/></td>
                <td><input type="submit" value="删除"></td>
            </tr>
            </tbody>
        </table>
    </form>
    <iframe name="delIframe" style="display:none;"></iframe>
</div>
</body>
</html>